from flask import g
def login_required(func):
    def wrapper(*args,**kwargs):
        if g.user_id is None:
            return {'msg':'请登录'},401
        if g.is_refresh:
            return {'msg':'请登录'},403
        return func(*args,**kwargs)
    return wrapper